#include "stdio.h"
#include "stdlib.h"

int main() {
    int num[] = {2, 5, 8, 4, 78, 64, 102, 79};
    int i, j, key;
    int len = sizeof(num) / sizeof(int);

    for (j = 2; j < len; j ++) {
        key = num[j];
        i = j - 1;
        while (i > 0 && num[i] > key) {
            num[i+1] = num[i];
            i --;
        }
        num[i+1] = key;
    }

    for (i = 0; i < len; i ++) {
        printf("%d\t", num[i]);
    }

    return 0;

}
